package com.hj.homework;

public class User {
    private String userType;
    private int id;

    public User() {
    }

    public User(String userType, int id) {
        this.userType = userType;
        this.id = id;
    }

    public String getUserType() {
        return userType;
    }

    public void setUserType(String userType) {
        this.userType = userType;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        User user = (User) o;

        if (id != user.id) return false;
        return userType != null ? userType.equals(user.userType) : user.userType == null;
    }

    @Override
    public int hashCode() {
        int result = userType != null ? userType.hashCode() : 0;
        result = 31 * result + id;
        return result;
    }

    @Override
    public String toString() {
        return "User{" +
                "userType='" + userType + '\'' +
                ", id=" + id +
                '}';
    }
}
